package com.blog.blogservice.domain.entity;

/**
 * @author guanglin.ma
 * @date 2024-03-10 16:32
 */
public class BaseResponse<T> {

    private String code;
    private T message;
    private String token;
    private String refreshToken;

    public BaseResponse(String code, T message) {
        this.code = code;
        this.message = message;
    }

    public BaseResponse() {
    }

    public static BaseResponse error(String s) {
        return new BaseResponse("20001", s);
    }

    public static BaseResponse ok() {
        return new BaseResponse("20000", "");
    }

    public static BaseResponse error(String code, String s) {
        return new BaseResponse(code, s);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getMessage() {
        return message;
    }

    public void setMessage(T message) {
        this.message = message;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }
}
